package com.sxkj.web.controller.version;

import com.sxkj.common.response.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.List;

import com.github.pagehelper.PageInfo;
import com.sxkj.entity.entity.version.VersionScale;
import com.sxkj.service.version.VersionScaleService;

/**
 * @author Zhang Xingliang
 *
 * @description: 秤定制版本
 * @date 2019-12-31 13:25:41
 */
@RestController
@RequestMapping("/version/versionScale")
public class VersionScaleController {

	/*@Autowired
	private VersionScaleService versionScaleService;

	@ApiOperation(value = "根据主键查秤定制版本信息")
	@GetMapping(value = "/get/{id}")
	public ResponseResult get(@PathVariable String id) {
		try {
			VersionScale versionScale = versionScaleService.get(id);
			return ResponseResult.success(versionScale);
		} catch (Exception e) {
			return ResponseResult.failure(e.toString());
		}
	}

	@ApiOperation(value = "新增秤定制版本信息")
	@RequestMapping(value = "/save", method = RequestMethod.POST)
	public ResponseResult save(@RequestBody VersionScale versionScale) {
		try {
			versionScaleService.save(versionScale);
			return ResponseResult.success();
		} catch (Exception e) {
			return ResponseResult.failure(e.toString());
		}
	}

	@ApiOperation(value = "删除秤定制版本信息")
	@RequestMapping(value = "/delete", method = RequestMethod.POST)
	public ResponseResult delete(@RequestBody VersionScale versionScale) {
		try {
			versionScaleService.delete(versionScale);
			return ResponseResult.success();
		} catch (Exception e) {
			return ResponseResult.failure(e.toString());
		}
	}

	@ApiOperation(value = "查询秤定制版本列表")
	@RequestMapping(value = "/findList", method = RequestMethod.POST)
	public ResponseResult findList(@RequestBody VersionScale versionScale) {
		try {
			return ResponseResult.success(versionScaleService.findList(versionScale));
		} catch (Exception e) {
			return ResponseResult.failure(e.toString());
		}
	}

	@ApiOperation(value = "查询秤定制版本列表")
	@RequestMapping(value = "/findPage", method = RequestMethod.POST)
	public ResponseResult findPage(@RequestBody VersionScale versionScale,
			@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize,
			@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
		try {
			PageInfo pageInfo = versionScaleService.findPage(versionScale, pageSize, pageNum);
			return ResponseResult.success(pageInfo);
		} catch (Exception e) {
			return ResponseResult.failure(e.toString());
		}
	}*/

}
